package com.qiaoya.deviceProxy;

import java.util.HashMap;
import java.util.Map;

import org.apache.mina.core.session.IoSession;

public class MsgIOSessionCache{

	private static Map<String, IoSession> linkCache = new HashMap<String,IoSession>();

	private static MsgIOSessionCache instance;

	private MsgIOSessionCache() {}

	public static MsgIOSessionCache getInstance() {
		if (instance == null) {
			instance = new MsgIOSessionCache();
		}
		return instance;
	}

	public void putIOSessionCache(String ip, IoSession item) {
		linkCache.put(ip, item);
	}

	public IoSession getIOSessionCacheItemFromIP(String ip) {
		return linkCache.get(ip);
	}

	public static Map<String, IoSession> getLinkCache() {
		return linkCache;
	}
}
